﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BackOffice.Master" AutoEventWireup="true"
    CodeBehind="CadastroMvtoFin.aspx.cs" Inherits="MakeIT.SGI.ERP.Apresentacao.CadastroMvtoFin" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="headHttpEquiv" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphTituloCadastro" runat="server">
    Movimento Financeiro (mvtofin)
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphMain" runat="server">
    <asp:UpdatePanel ID="upnMvtoFin" runat="server">
        <ContentTemplate>
            <asp:TabContainer ID="tabMvtoFin" runat="server" ActiveTabIndex="0">
                <asp:TabPanel ID="tabPesquisa" runat="server" HeaderText="Pesquisa">
                    <ContentTemplate>
                        <div style="width: 100%; background-color: #eeeeff; min-width: 400px; min-height: 300px;">
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td valign="middle" style="width: 24px;">
                                        <asp:ImageButton ID="ibPesquisa" runat="server" OnClick="btnPesquisa_Click" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/search.png"
                                            ToolTip="Executa a pesquisa aplicando os filtros" />
                                    </td>
                                    <td valign="middle" align="left">
                                        Filtros:
                                    </td>
                                    <td>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                C&oacute;digo:</div>
                                            <asp:TextBox ID="txtIdMvtoFin" MaxLength="11" Width="76px" onkeypress="strictNum();"
                                                onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server"></asp:TextBox>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Filial:</div>
                                            <asp:DropDownList ID="ddlIdFilial" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="Filial" DataValueField="PKString" AutoPostBack="True"
                                                OnSelectedIndexChanged="filtraFilialDDL">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Banco:</div>
                                            <asp:DropDownList ID="ddlIdBanco" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="idFornecedor" DataValueField="PKString" AutoPostBack="True"
                                                OnSelectedIndexChanged="ddlBanco_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Conta&nbsp;Corrente:</div>
                                            <asp:DropDownList ID="ddlIdCtaCor" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="CtaCor" DataValueField="PKString">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Fornecedor:</div>
                                            <asp:DropDownList ID="ddlIdFornecedor" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="pessoa" DataValueField="PKString">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Cliente:</div>
                                            <asp:DropDownList ID="ddlIdClienteRec" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="pessoa" DataValueField="PKString">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Forma&nbsp;de&nbsp;Pagamento:</div>
                                            <asp:DropDownList ID="ddlIdFormaPgto" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="FormaPgto" DataValueField="PKString">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Plano&nbsp;de&nbsp;Conta:</div>
                                            <asp:DropDownList ID="ddlIdPlnCta" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="PlnCta" DataValueField="PKString">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Centro&nbsp;de&nbsp;Lucro:</div>
                                            <asp:DropDownList ID="ddlIdCLucroRec" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="CCusto" DataValueField="PKString">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Centro&nbsp;de&nbsp;Custo:</div>
                                            <asp:DropDownList ID="ddlIdCCusto" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="CCusto" DataValueField="PKString">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Caixa:</div>
                                            <asp:DropDownList ID="ddlIdCaixa" Width="76px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server" DataTextField="Caixa" DataValueField="PKString">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                C&oacute;digo&nbsp;T&iacute;tulo&nbsp;a&nbsp;receber:</div>
                                            <asp:TextBox ID="txtIdTitRec" MaxLength="11" Width="76px" onkeypress="strictNum();"
                                                onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server"></asp:TextBox>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                C&oacute;digo&nbsp;T&iacute;tulo&nbsp;a&nbsp;pagar:</div>
                                            <asp:TextBox ID="txtIdTitPag" MaxLength="11" Width="76px" onkeypress="strictNum();"
                                                onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server"></asp:TextBox>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Documento:</div>
                                            <asp:TextBox ID="txtNrDoc" MaxLength="50" Width="310px" ForeColor="DarkBlue" Font-Bold="True"
                                                runat="server"></asp:TextBox>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Filtar:
                                            </div>
                                            <asp:DropDownList ID="ddlFiltrar" runat="server">
                                                <asp:ListItem Text=" " Value="0"></asp:ListItem>
                                                <asp:ListItem Text="Caixa" Value="C"></asp:ListItem>
                                                <asp:ListItem Text="T&iacute;tulo&nbsp;a&nbsp;Pagar" Value="P"></asp:ListItem>
                                                <asp:ListItem Text="T&iacute;tulo&nbsp;a&nbsp;Receber" Value="R"></asp:ListItem>
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Natureza:
                                            </div>
                                            <asp:DropDownList ID="ddlNatureza" runat="server">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel" align="center">
                                                Data&nbsp;de&nbsp;Vencimento:
                                            </div>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    De:
                                                </div>
                                                <asp:TextBox ID="txtdtMvtoFinDe" MaxLength="10" Width="80px" onkeypress="MascaraData();"
                                                    onblur="validaData();" ForeColor="DarkBlue" Font-Bold="True" runat="server"></asp:TextBox>
                                                <asp:ImageButton ID="imgtxtdtMvtoFinDe" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/Calendario.png" />
                                                <asp:CalendarExtender ID="cetxtdtMvtoFinDe" runat="server" DaysModeTitleFormat="dd/MM/yyyy"
                                                    Enabled="True" TargetControlID="txtdtMvtoFinDe" BehaviorID="imgtxtdtMvtoFinDe"
                                                    PopupButtonID="imgtxtdtMvtoFinDe" Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
                                                </asp:CalendarExtender>
                                            </div>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    At&eacute;:</div>
                                                <asp:TextBox ID="dtMvtoFinAte" MaxLength="10" Width="80px" onkeypress="MascaraData();"
                                                    onblur="validaData();" ForeColor="DarkBlue" Font-Bold="True" runat="server"></asp:TextBox>
                                                <asp:ImageButton ID="imgdtMvtoFinAte" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/Calendario.png" />
                                                <asp:CalendarExtender ID="cedtMvtoFinAte" runat="server" DaysModeTitleFormat="dd/MM/yyyy"
                                                    Enabled="True" TargetControlID="dtMvtoFinAte" BehaviorID="imgdtMvtoFinAte" PopupButtonID="imgdtMvtoFinAte"
                                                    Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
                                                </asp:CalendarExtender>
                                            </div>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel" align="center">
                                                Valor:</div>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    De:</div>
                                                <asp:TextBox ID="txtValorDe" MaxLength="17" Width="80px" onkeypress="mascaraMoeda();"
                                                    ForeColor="DarkBlue" Font-Bold="True" runat="server"></asp:TextBox>
                                            </div>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    At&eacute;:</div>
                                                <asp:TextBox ID="txtValorAte" MaxLength="17" Width="80px" onkeypress="mascaraMoeda();"
                                                    ForeColor="DarkBlue" Font-Bold="True" runat="server"></asp:TextBox>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <hr />
                            <asp:GridView ID="grvResultado" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros nessa pesquisa!"
                                CellPadding="1" ForeColor="#333333" EnableModelValidation="True" OnRowDataBound="grvResultado_RowDataBound">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:Image ID="imgVisualizarCaixa" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/Caixa.png"
                                                ToolTip='<%# "Movimenta&ccedil;&atilde;o&nbsp;originaria&nbsp;do&nbsp;caixa&nbsp;de&nbsp;ID:&nbsp;" + Eval("idCaixa") %>' />
                                            <asp:HyperLink ID="hlbVisualizarTitRec" runat="server" NavigateUrl='<%# "~/CadastroTituloPagRec.aspx?id=" + Eval("idTitRec") + "&tipo=r" %>'
                                                ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/TitRec.png" Target="CadastroTituloPagRec"
                                                ToolTip="Abrir formulário completo titulo receber"></asp:HyperLink>
                                            <asp:HyperLink ID="hlbVisualizarTitPag" runat="server" NavigateUrl='<%# "~/CadastroTituloPagRec.aspx?id=" + Eval("idTitPag") + "&tipo=p" %>'
                                                ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/TitPag.png" Target="CadastroTituloPagRec"
                                                ToolTip="Abrir formulário completo titulo pagar"></asp:HyperLink>
                                            <asp:ImageButton ID="imgbVisualizar" runat="server" OnClick="imgbVisualizar_Click"
                                                ImageUrl="~/App_Themes/Padrao/imagens/backoffice/editar.gif" CommandArgument='<%#Eval("PKString") %>'
                                                ToolTip="Abrir formulário completo movimento financeiro" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="idMvtoFin" HeaderText="C&oacute;digo" DataFormatString="{0:N0}" />
                                    <asp:BoundField DataField="valor" HeaderText="Valor" DataFormatString="{0:C}" />
                                    <asp:BoundField DataField="valorJuro" HeaderText="Valor de Acrescimo" DataFormatString="{0:C}" />
                                    <asp:BoundField DataField="valorDesc" HeaderText="Valor de Desconto" DataFormatString="{0:C}" />
                                    <asp:BoundField DataField="valorPago" HeaderText="Valor de Pago" DataFormatString="{0:C}" />
                                </Columns>
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#999999" />
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            </asp:GridView>
                        </div>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="tabCadastro" runat="server" HeaderText="Cadastro">
                    <ContentTemplate>
                        <asp:Panel ID="panelCad" runat="server" BackColor="#eeeeee">
                            <div style="width: 100%; min-width: 400px; min-height: 300px;">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <asp:Panel ID="panelBotoes" runat="server">
                                                <asp:Button ID="btnSalvar" runat="server" Enabled="False" ValidationGroup="Salvar"
                                                    OnClick="btnSalvar_Click" Text="Salvar" UseSubmitBehavior="false" />
                                                &nbsp;<asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" Text="Cancelar"
                                                    UseSubmitBehavior="false" />
                                                &nbsp;<asp:Button ID="btnNovo" runat="server" OnClick="btnNovo_Click" Text="Novo"
                                                    UseSubmitBehavior="false" />
                                                <hr />
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    C&oacute;digo:</div>
                                                <asp:TextBox ID="txtCadIdMvtoFin" MaxLength="11" Width="76" onkeypress="strictNum();"
                                                    onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="true"
                                                    runat="server"></asp:TextBox>
                                                <asp:MaskedEditExtender ID="meetxtCadIdMvtoFin" runat="server" Mask="99999999999"
                                                    TargetControlID="txtCadIdMvtoFin" PromptCharacter="" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Filial:</div>
                                                <asp:DropDownList ID="ddlCadIdFilial" Width="76" ForeColor="DarkBlue" Font-Bold="true"
                                                    runat="server" DataTextField="Filial" DataValueField="PKString" AutoPostBack="true"
                                                    OnSelectedIndexChanged="filtraFilialDDL">
                                                </asp:DropDownList>
                                                <asp:HyperLink ID="HyperLinkCadIdFilial" runat="server" NavigateUrl="~/CadastroFilial.aspx"
                                                    ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" Target="CadastroFilial"
                                                    ToolTip="Editar cadastro"></asp:HyperLink>
                                                <asp:ImageButton ID="ImageButtonCadIdFilial" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/atualizar.png"
                                                    ToolTip="Atualizar lista" OnClick="atualizarDdlIdFilial" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Natureza:</div>
                                                <asp:DropDownList ID="ddlCadNatureza" ForeColor="DarkBlue" Font-Bold="true" runat="server"
                                                    OnSelectedIndexChanged="ddlCadNatureza_SelectedIndexChanged" AutoPostBack="true" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Panel runat="server" ID="pnlResTicket">
                                                <div class="FormDiv">
                                                    <div class="FormLabel">
                                                        Ticket</div>
                                                    <asp:CheckBox ID="cbProvisaoResgatarTickt" runat="server" AutoPostBack="True" OnCheckedChanged="cbProvisaoResgatarTickt_CheckedChanged"
                                                        Text="Resgatar Ticket" />
                                                    <asp:DropDownList ID="ddlProvisaoTicket" runat="server">
                                                    </asp:DropDownList>
                                                </div>
                                                <br />
                                                <div class="FormDiv">
                                                    <asp:Label ID="lblProvisaoErro" runat="server" Text="Label" CssClass="popupAviso"></asp:Label>
                                                </div>
                                            </asp:Panel>
                                            <asp:Panel runat="server" ID="pnlGerTicket">
                                                <div class="FormDiv">
                                                    <div class="FormLabel">
                                                        Ticket</div>
                                                    <asp:CheckBox ID="cbSangriaTicketGerar" runat="server" Text="Gerar Ticket" OnCheckedChanged="cbSangriaTicketGerar_CheckedChanged"
                                                        AutoPostBack="true" />
                                                </div>
                                                <div class="FormDiv">
                                                    <div class="FormLabel">
                                                        Finalidade</div>
                                                    <asp:TextBox ID="txtSangriaTicketFinalidade" runat="server" MaxLength="45"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ControlToValidate="txtSangriaTicketFinalidade" ErrorMessage="Preenchimento obrigat&oacute;rio."
                                                        ID="rfvtxtSangriaTicketFinalidade" Display="None" runat="server" ValidationGroup="Salvar"></asp:RequiredFieldValidator>
                                                    <asp:ValidatorCalloutExtender ID="vcetxtSangriaTicketFinalidade" runat="server" TargetControlID="rfvtxtSangriaTicketFinalidade"
                                                        Enabled="false">
                                                    </asp:ValidatorCalloutExtender>
                                                </div>
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Conta&nbsp;Corrente:</div>
                                                <asp:DropDownList ID="ddlCadIdCtaCor" Width="76" ForeColor="DarkBlue" Font-Bold="true"
                                                    runat="server" DataTextField="CtaCor" DataValueField="PKString">
                                                </asp:DropDownList>
                                                <asp:HyperLink ID="HyperLinkCadIdCtaCor" runat="server" NavigateUrl="~/CadastroBanco.aspx"
                                                    ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" Target="CadastroBanco"
                                                    ToolTip="Editar cadastro"></asp:HyperLink>
                                                <asp:ImageButton ID="ImageButtonCadIdCtaCor" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/atualizar.png"
                                                    ToolTip="Atualizar lista" OnClick="atualizarDdlIdCtaCor" />
                                            </div>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Banco:</div>
                                                <asp:DropDownList ID="ddlCadIdBanco" Width="76" ForeColor="DarkBlue" Font-Bold="true"
                                                    runat="server" DataTextField="idFornecedor" DataValueField="PKString" AutoPostBack="true"
                                                    OnSelectedIndexChanged="ddlBanco_SelectedIndexChanged">
                                                </asp:DropDownList>
                                                <asp:HyperLink ID="HyperLinkCadBanco" runat="server" NavigateUrl="~/CadastroBanco.aspx"
                                                    ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" Target="CadastroBanco"
                                                    ToolTip="Editar cadastro"></asp:HyperLink>
                                                <asp:ImageButton ID="ImageButtonCadIdBanco" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/atualizar.png"
                                                    ToolTip="Atualizar lista" OnClick="atualizarDdlIdBanco" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Forma&nbsp;de&nbsp;Pagamento:</div>
                                                <asp:DropDownList ID="ddlCadIdFormaPgto" Width="76" ForeColor="DarkBlue" Font-Bold="true"
                                                    runat="server" DataTextField="FormaPgto" DataValueField="PKString">
                                                </asp:DropDownList>
                                                <asp:HyperLink ID="HyperLinkCadIdFormaPgto" runat="server" NavigateUrl="~/CadastroFormapgto.aspx"
                                                    ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" Target="CadastroFormapgto"
                                                    ToolTip="Editar cadastro"></asp:HyperLink>
                                                <asp:ImageButton ID="ImageButtonCadIdFormaPgto" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/atualizar.png"
                                                    ToolTip="Atualizar lista" OnClick="atualizarDdlIdFormaPgto" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Plano&nbsp;de&nbsp;Conta:</div>
                                                <asp:DropDownList ID="ddlCadIdPlnCta" Width="76" ForeColor="DarkBlue" Font-Bold="true"
                                                    runat="server" DataTextField="PlnCta" DataValueField="PKString">
                                                </asp:DropDownList>
                                                <asp:HyperLink ID="HyperLinkCadIdPlnCta" runat="server" NavigateUrl="~/CadastroPlncta.aspx"
                                                    ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" Target="CadastroPlncta"
                                                    ToolTip="Editar cadastro"></asp:HyperLink>
                                                <asp:ImageButton ID="ImageButtonCadIdPlnCta" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/atualizar.png"
                                                    ToolTip="Atualizar lista" OnClick="atualizarDdlIdPlnCta" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Panel runat="server" ID="pnlCadFornecedor">
                                                <div class="FormDiv">
                                                    <div class="FormLabel">
                                                        Fornecedor:</div>
                                                    <asp:DropDownList ID="ddlCadIdFornecedor" Width="76" ForeColor="DarkBlue" Font-Bold="true"
                                                        runat="server" DataTextField="idFornecedor" DataValueField="PKString">
                                                    </asp:DropDownList>
                                                    <asp:HyperLink ID="HyperLinkCadIdFornecedor" runat="server" NavigateUrl="~/CadastroFornecedor.aspx"
                                                        ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" Target="CadastroFornecedor"
                                                        ToolTip="Editar cadastro"></asp:HyperLink>
                                                    <asp:ImageButton ID="ImageButtonCadIdFornecedor" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/atualizar.png"
                                                        ToolTip="Atualizar lista" OnClick="atualizarDdlIdFornecedor" />
                                                </div>
                                                <div class="FormDiv">
                                                    <div class="FormLabel">
                                                        Pesquisar Fonecedor:</div>
                                                    <asp:TextBox ID="txtCadPesquisarFornecedor" MaxLength="60" Width="100" ForeColor="DarkBlue"
                                                        Font-Bold="true" runat="server"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ControlToValidate="txtCadPesquisarFornecedor" ErrorMessage="Preenchimento obrigat&oacute;rio."
                                                        ID="rfvTxtCadPesquisarFornecedor" Display="None" runat="server" ValidationGroup="fornecedor"></asp:RequiredFieldValidator>
                                                    <asp:ValidatorCalloutExtender ID="vceTxtCadPesquisarFornecedor" runat="server" TargetControlID="rfvTxtCadPesquisarFornecedor">
                                                    </asp:ValidatorCalloutExtender>
                                                </div>
                                                <div class="FormDiv">
                                                    <asp:ImageButton ID="btnPesquisarFornecedor" runat="server" OnClick="btnPesquisarFornecedor_Click"
                                                        ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/search.png" ToolTip="Executa a pesquisa aplicando os filtros"
                                                        ValidationGroup="fornecedor" Enabled="false" />
                                                </div>
                                            </asp:Panel>
                                            <asp:Panel runat="server" ID="pnlCadCliente">
                                                <div class="FormDiv">
                                                    <div class="FormLabel">
                                                        Cliente:</div>
                                                    <asp:DropDownList ID="ddlCadIdClienteRec" Width="76" ForeColor="DarkBlue" Font-Bold="true"
                                                        runat="server" DataTextField="idCliente" DataValueField="PKString">
                                                    </asp:DropDownList>
                                                    <asp:HyperLink ID="HyperLinkCadIdCliente" runat="server" NavigateUrl="~/CadastroCliente.aspx"
                                                        ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" Target="CadastroCliente"
                                                        ToolTip="Editar cadastro"></asp:HyperLink>
                                                    <asp:ImageButton ID="ImageButtonCadIdCliente" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/atualizar.png"
                                                        ToolTip="Atualizar lista" OnClick="atualizarddlCadIdClienteRec" />
                                                </div>
                                                <div class="FormDiv">
                                                    <div class="FormLabel">
                                                        Pesquisar Cliente:</div>
                                                    <asp:TextBox ID="txtCadPesquisarClienteRec" MaxLength="60" Width="100" ForeColor="DarkBlue"
                                                        Font-Bold="true" runat="server"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ControlToValidate="txtCadPesquisarClienteRec" ErrorMessage="Preenchimento obrigat&oacute;rio."
                                                        ID="rfvtxtCadPesquisarClienteRec" Display="None" runat="server" ValidationGroup="Cliente"></asp:RequiredFieldValidator>
                                                    <asp:ValidatorCalloutExtender ID="vcetxtCadPesquisarClienteRec" runat="server" TargetControlID="rfvtxtCadPesquisarClienteRec">
                                                    </asp:ValidatorCalloutExtender>
                                                </div>
                                                <div class="FormDiv">
                                                    <asp:ImageButton ID="btnPesquisarClienteRec" runat="server" OnClick="btnPesquisarClienteRec_Click"
                                                        ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/search.png" ToolTip="Executa a pesquisa aplicando os filtros"
                                                        ValidationGroup="Cliente" Enabled="false" />
                                                </div>
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Panel runat="server" ID="pnlCadCCusto">
                                                <div class="FormDiv">
                                                    <div class="FormLabel">
                                                        Centro&nbsp;de&nbsp;Custo:</div>
                                                    <asp:DropDownList ID="ddlCadIdCCusto" Width="76" ForeColor="DarkBlue" Font-Bold="true"
                                                        runat="server" DataTextField="CCusto" DataValueField="PKString">
                                                    </asp:DropDownList>
                                                    <asp:HyperLink ID="HyperLinkCadIdCCusto" runat="server" NavigateUrl="~/CadastroCcusto.aspx"
                                                        ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" Target="CadastroCcusto"
                                                        ToolTip="Editar cadastro"></asp:HyperLink>
                                                    <asp:ImageButton ID="ImageButtonCadIdCCusto" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/atualizar.png"
                                                        ToolTip="Atualizar lista" OnClick="atualizarDdlIdCCusto" />
                                                </div>
                                            </asp:Panel>
                                            <asp:Panel runat="server" ID="pnlCadCLucro">
                                                <div class="FormDiv">
                                                    <div class="FormLabel">
                                                        Centro&nbsp;de&nbsp;Lucro:</div>
                                                    <asp:DropDownList ID="ddlCadIdCLucro" Width="76" ForeColor="DarkBlue" Font-Bold="true"
                                                        runat="server" DataTextField="CCusto" DataValueField="PKString">
                                                    </asp:DropDownList>
                                                    <asp:HyperLink ID="HyperLinkCadIdCLucro" runat="server" NavigateUrl="~/CadastroCLucro.aspx"
                                                        ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" Target="CadastroCLucro"
                                                        ToolTip="Editar cadastro"></asp:HyperLink>
                                                    <asp:ImageButton ID="ImageButtonCadIdCLucro" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/atualizar.png"
                                                        ToolTip="Atualizar lista" OnClick="atualizarddlIdCLucro" />
                                                </div>
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Data&nbsp;de&nbsp;Vencimento:</div>
                                                <asp:TextBox ID="txtCadVcto" MaxLength="10" Width="80" onkeypress="MascaraData();"
                                                    onblur="validaData();" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:ImageButton ID="imgtxtCadVcto" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/Calendario.png" />
                                                <asp:CalendarExtender ID="cetxtCadVcto" runat="server" DaysModeTitleFormat="dd/MM/yyyy"
                                                    Enabled="True" TargetControlID="txtCadVcto" BehaviorID="imgtxtCadVcto" PopupButtonID="imgtxtCadVcto"
                                                    Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
                                                </asp:CalendarExtender>
                                                <asp:RequiredFieldValidator ControlToValidate="txtCadVcto" ErrorMessage="Preenchimento obrigat&oacute;rio."
                                                    ID="rfvtxtCadVcto" Display="None" runat="server" ValidationGroup="Salvar"></asp:RequiredFieldValidator>
                                                <asp:ValidatorCalloutExtender ID="vcetxtCadVcto" runat="server" TargetControlID="rfvtxtCadVcto">
                                                </asp:ValidatorCalloutExtender>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Panel runat="server" ID="pnlValores">
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <div class="FormDiv">
                                                                <div class="FormLabel">
                                                                    Documento:</div>
                                                                <asp:TextBox ID="txtCadNrDoc" MaxLength="50" Width="310" ForeColor="DarkBlue" Font-Bold="true"
                                                                    runat="server"></asp:TextBox>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div class="FormDiv">
                                                                <div class="FormLabel">
                                                                    Valor&nbsp;do&nbsp;T&iacute;tulo:</div>
                                                                <asp:TextBox ID="txtCadValor" MaxLength="17" Width="112" onkeypress="mascaraMoeda();"
                                                                    ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                                <asp:RequiredFieldValidator ControlToValidate="txtCadValor" ErrorMessage="Preenchimento obrigat&oacute;rio."
                                                                    ID="rfvtxtCadValor" Display="None" runat="server" ValidationGroup="Salvar"></asp:RequiredFieldValidator>
                                                                <asp:ValidatorCalloutExtender ID="vcetxtCadValor" runat="server" TargetControlID="rfvtxtCadValor">
                                                                </asp:ValidatorCalloutExtender>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div class="FormDiv">
                                                                <div class="FormLabel">
                                                                    Valor&nbsp;Acrescimos&nbsp;Cobrado:</div>
                                                                <asp:TextBox ID="txtCadValorJuroC" MaxLength="17" Width="112" onkeypress="mascaraMoeda();"
                                                                    ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div class="FormDiv">
                                                                <div class="FormLabel">
                                                                    Valor&nbsp;Desconto&nbsp;Concedido:</div>
                                                                <asp:TextBox ID="txtCadValorDescC" MaxLength="17" Width="112" onkeypress="mascaraMoeda();"
                                                                    ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div class="FormDiv">
                                                                <div class="FormLabel">
                                                                    Valor&nbsp;Pago:</div>
                                                                <asp:TextBox ID="txtCadValorPago" MaxLength="17" Width="112" onkeypress="mascaraMoeda();"
                                                                    ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div class="FormDiv">
                                                                <div class="FormLabel">
                                                                    Valor&nbsp;Saldo:</div>
                                                                <asp:TextBox ID="txtCadValorSaldo" MaxLength="17" Width="112" onkeypress="mascaraMoeda();"
                                                                    ForeColor="DarkBlue" Font-Bold="true" runat="server" ReadOnly="true"></asp:TextBox>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <hr />
                                            <table border="0" cellpadding="0" cellspacing="3">
                                                <tr>
                                                    <td class="FormLabel">
                                                        Data Cadastro:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Cadastrado por:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Data Edi&ccedil;&atilde;o:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Editado por:
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltDataCadastro" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltCadastradoPor" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltDataEdicao" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltEditadoPor" runat="server"></asp:Literal>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>
            </asp:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
